#include <iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<stdio.h>
#include<unordered_set>
using namespace std;

//用两个不同方向的最大数组即可
int main()
{
	int n;
	cin >> n;
	int* arr = new int[n];
	int* leftmax = new int[n];
	int* rightmax = new int[n];
	
	
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	for (int i = 0; i < n; i++)
	{
		if (i==0|| leftmax[i-1] < arr[i])
		{
			leftmax[i] = arr[i];
		}
		else{ leftmax[i] = leftmax[i - 1]; }
	}

	for (int i = n-1; i >-1; i--)
	{
		if (i == n - 1 || rightmax[i + 1] < arr[i])
		{
			rightmax[i] = arr[i];
		}
		else { rightmax[i] = rightmax[i + 1]; }
	}
	int tmp = 0;
	for (int i = 0; i < n; i++)
	{
		if (i == 0 && arr[0] >= rightmax[0]) { tmp++; continue; }
		if (i == n-1 && arr[n-1] >= leftmax[n - 1]) { tmp++; continue; }
		if (arr[i] >= leftmax[i] && arr[i] >= rightmax[i]) { tmp++;  }
	}
	cout << tmp;
}